class Device:

    # {
    #     addr:"12",
    #     name:"电表", //设备唯一编码
    #     type:"modbus",
    #     host:"192.168.50.2",
    #     port:5000,
    #     topic:"juji/device_msg/",
    #     rpctopic:"juji/device_msg/rpc",
    #     ts:[],
    #     rpc:{},
    #     byteOrder:"BIG",
    #     wordOrder:"BIG"
    # }
    def __init__(self, config: dict):
        self.addr = config.get("addr")
        self.name = config.get("name")
        self.type = config.get("type")
        self.host = config.get("host")
        self.port = config.get("port")
        self.topic = config.get("topic")
        self.rpctopic = config.get("rpctopic")
        self.ts = config.get("ts")
        self.rpc = config.get("rpc")
        self.byteOrder = config.get("byteOrder")
        self.wordOrder = config.get("wordOrder")
